def fac(k) :
    i = 2
    t = 1
    while i <= k:
        t *= i
        i +=1
    return t
def sun(n) :
    s = 1
    i = 1
    while i <= n:
        s = s + fac(i)
        i += 3
    return s
print('1!+2!+3!+4!...50!=', sun(50))





